<?php
/* 
 * Copyright (c) 2018-2021  * 
 * 创建时间：2021-04-24 06:14
 *
 * 项目：upload  -  $  - levssqController.php
 *
 * 作者：liwei 
 */


namespace modules\levmodules\controllers;

!defined('INLEV') && exit('Access Denied LEV');

use CURLFile;
use lev\helpers\dbHelper;
use modules\levfm\table\LevfmForms;
use Lev;
use lev\base\Adminv;
use lev\base\Assetsv;
use lev\base\Controllerv;
use lev\base\Modelv;
use lev\base\Viewv;
use lev\helpers\cacheFileHelpers;
use lev\helpers\ModulesHelper;
use lev\helpers\UrlHelper;
use lev\widgets\inputs\inputsWidget;
use modules\levmodules\helpers\generateControllerHelper;
use modules\levmodules\helpers\generateHelper;
use modules\levmodules\helpers\levmodulesSetHelper;
use modules\levmodules\helpers\zipHelper;
use modules\levmodules\helpers\zipUploadServerHelper;
use modules\levmodules\table\form\Form_lev_modules\Form_lev_modules;
use modules\levmodules\table\lev_modules\levModulesModelHelper;

Adminv::checkAccess();
Assetsv::registerSuperman();

class ModulesController extends Controllerv {

    /**
     * Renders the index view for the module
     */
    public function actionIndex()
    {
        parent::redirect(Lev::toReRoute(['admin-modules']));

        //以下旧版 已停更

        if ($adminop = Lev::POSTv('adminop')) {
            if (($tips = ModulesHelper::adminop($adminop)) !== null) {
                echo json_encode($tips);
                return;
            }
        }

        $classdir = Lev::stripTags(Lev::GPv('classdir'));
        if ($classdir) {
            $where = "classdir='$classdir' OR identifier='$classdir'";
        }else {
            $where = 1;
        }

        $lists = ModulesHelper::findAll($where, '', ['uptime DESC']);

        Lev::$app['title'] = '模块管理';

        Viewv::render('_modules/index', [
            'lists' => $lists,
        ]);

    }

    public function actionZip() {
        $iden = Lev::stripTags(Lev::GPv('iden'));
        $mudInfo = ModulesHelper::getModuleInfo($iden);
        $idenDir = ModulesHelper::getIdenDir($iden);

        $uploadZipStore = Lev::GPv('store');//上传到模块商店
        $ftpServer = Lev::stripTags(Lev::GPv('ftpServer'));//ftp上传至我的服务器

        $cacheZipConfig = levModulesModelHelper::cacheZipConfig($iden);
        if (!Lev::GPv('doit')) {
            Lev::$app['title'] = $mudInfo['name'].' - 模块压缩 - v'.$mudInfo['version'];
            $appviden = Lev::$aliases['@modules'].'/'.APPVIDEN;
            //$unglobs[$appviden.'/web/data 上传等用户产生的文件'] = 1;
            $unglobs[$appviden.'/runtime 运行目录'] = 1;
            $unglobs['/*.map .bak 后缀文件'] = 1;
            $unglobs['/_lev_dev.bin 开发模式识别文件'] = 1;
            $unglobs['/README.md README 自述文件'] = 1;
            $unglobs['/__table _lev_demo _lev.config.php _lev_dev.bin vendor 等测试数据目录'] = 1;
            $unglobs['/{MODULEIDEN}.inc.php 子模块路由文件'] = 1;
            $unglobs['/.* 点【.】开头的文件'] = 1;

            //前置、子模块
            //$childglobs[$appviden.'/controllers/InstallController.php'] = 1;
            //$childglobs[$appviden.'/controllers/UninstallController.php'] = 1;
            $childglobs[$appviden.'/web/assets/statics/images/slide.jpg'] = 1;
            $childglobs[Lev::$aliases['@modules'].'/'.$iden.'/discuz_plugin_'.$iden.'_SC_GBK.xml'] = 1;
            $childglobs[Lev::$aliases['@modules'].'/'.$iden.'/modules'] = 1;
            $_files = glob(Lev::$aliases['@modules'].'/'.$iden.'/modules/*/');
            $_files2= glob(Lev::$aliases['@modules'].'/'.$iden.'/web/assets/mud/*/');
            $_files = $_files2 && $_files ? array_merge($_files, $_files2) : ($_files2 ?: $_files);
            if ($_files) {
                $_files = array_map(function ($v) { return rtrim($v, '/'); }, $_files);
                $childglobs += array_flip($_files);
            }
            unset($childglobs[Lev::$aliases['@modules'].'/'.$iden.'/web/assets/mud/'.APPVIDEN]);

            //不常用静态文件
            $statics = Lev::$aliases['@modules'].'/'.APPVIDEN.'/web/assets/statics';
            $globs[$statics.'/editor'] = 1;
            $globs[$statics.'/common/fonts'] = 1;
            $globs[$statics.'/common/flipclock'] = 1;
            $globs+= Lev::globs($statics.'/common', $globs, [
                $statics.'/common/jquery.min.js' => 1,
                $statics.'/common/jquery.form.min.js' => 1,
                $statics.'/common/iconfont.js' => 1,
            ]);
            $globs['Lev widgets 小部件'] = 1;
            $globs+= array_flip(glob(Lev::$aliases['@lev'].'/widgets/*'));
            $globs['web目录 网站根目录'] = 1;
            $globs+= array_flip(glob(Lev::$aliases['@webroot'] . '/*'));
            $globs[Lev::$aliases['@webroot'] . '/.htaccess'] = 1;
            $globs[Lev::$aliases['@webroot'] . '/data/assets'] = 1;

            $dunFiles = $globs + $childglobs;
            $dunFiles[$appviden.'/web/data'] = 1;
            $dunFiles[$appviden.'/runtime'] = 1;
            $dunFiles[Lev::$aliases['@modules'].'/'.$iden.'/__replace_files.bak'] = 1;
            $dunFiles[$iden.'/modules'] = 1;

            $zipInfo = zipHelper::getMudFilesAndChangeFiles($iden);

            //模块剩余全部文件
            $globsIden = Lev::globs(Lev::$aliases['@modules'].'/'.$idenDir, $dunFiles, $dunFiles);
            $totals = count($globsIden);
            Assetsv::animateCss();
            Viewv::render('_modules/zip', [
                'mudInfo'    => $mudInfo,
                'childglobs' => $childglobs,
                'unglobs'    => $unglobs,
                'globs'      => $globs,
                'globsIden'  => $globsIden,
                'totals'     => $totals,
                'unFiles'    => zipHelper::zipUnFiles($iden) ?: (isset($cacheZipConfig['unFiles']) ? $cacheZipConfig['unFiles'] : $dunFiles),
                'dunFiles'   => $dunFiles,
                'ftpServers' => levmodulesSetHelper::serversOpen(),
                'updateDesc' => empty($zipInfo['changeFiles']['updateDesc']) ? (isset($cacheZipConfig['updateDesc']) ? $cacheZipConfig['updateDesc'] : '新版首发') : $zipInfo['changeFiles']['updateDesc'],
                'LevVersion' => $zipInfo['changeFiles']['LevVersion'] ?: ($cacheZipConfig['LevVersion'] ?: levmodulesSetHelper::LevVersion()),
                'LevVersions'=> zipHelper::versions('levs'),
                'uploadZipStore' => $uploadZipStore,
                'btns'       => [
                    '导出并压缩' => Lev::toCurrent(['doit'=>1, 'addlev'=>0]),
                    //'<font color=yellow>导出压缩为独立版</font>' => Lev::toCurrent(['doit'=>1, 'addlev'=>1]),
                    //'仅压缩为前置版' => Lev::toCurrent(['doit'=>1, 'addlev'=>0, 'opid'=>0]),
                    //'仅压缩为独立版' => Lev::toCurrent(['doit'=>1, 'addlev'=>1, 'opid'=>0]),
                    '仅上传最新版'   => Lev::toCurrent(['doit'=>1, 'onlyftp'=>1]),
                ]
            ]);
            return;
        }
        $opid = floatval(Lev::GPv('opid'));
        if ($opid >0) {
            Form_lev_modules::doExport($opid);//导出模块数据
            SettingsController::doExport();//导出模块设置数据
        }
        ($unfiles = Lev::GPv('unfiles')) && $unfiles = array_flip($unfiles);

        if ($repv = Lev::GPv('replaceinlev')) {
            if ($repv === 'INLEV') {
                $replaces['add INLEV'] = 'add INLEV';
                $unfiles['add INLEV'] = 'add INLEV';
            }else {
                $replaces['!defined(\'INLEV\') && exit'] = '!defined(\'IN_DISCUZ\') && exit';
                $replaces['!defined(\'INLEV\') &&exit'] = '!defined(\'IN_DISCUZ\') && exit';
                $replaces['!defined(\'INLEV\')&& exit'] = '!defined(\'IN_DISCUZ\') && exit';
                $replaces['!defined(\'INLEV\')&&exit'] = '!defined(\'IN_DISCUZ\') && exit';
                $replaces['\'Access Denied LEV\''] = '\'Access Denied\'';
                $replaces["\$inLev = '!defined(\'INLEV\') && exit(\'Access Denied Levset\');'"]
                    = "\$inLev = '!defined(\'IN_DISCUZ\') && exit(\'Access Denied Levset\');'";

                $unfiles['add IN_DISCUZ'] = 'add IN_DISCUZ';
            }
        }//echo '<pre>';print_r($unfiles);exit;

        $updateDesc = Lev::removeScript(Lev::GPv('updateDesc'));
        $LevVersion = Lev::stripTags(Lev::GPv('LevVersion'));
        $zip[] = '未执行压缩';
        levModulesModelHelper::cacheZipConfig($iden, [
            'iden'       => $iden,
            'classdir'   => false,
            'addLev'     => Lev::stripTags(Lev::GPv('addlev')),
            'unFiles'    => $unfiles,
            'replaces'   => $replaces,
            'updateDesc' => $updateDesc,
            'export'     => $opid,
            'LevVersion' => $LevVersion,
        ]);
        if (!Lev::GPv('onlyftp')) {
            zipHelper::$changeFiles['LevVersion'] = $LevVersion;
            $zip = zipHelper::doZip($iden, false, Lev::GPv('addlev'), $unfiles, $replaces, $updateDesc);
        }
        if ($uploadZipStore) {
            $zip['商店上传结果'] = zipUploadServerHelper::uploadStore($iden);
        }else if ($ftpServer) {
            $zip['上传结果'] = zipUploadServerHelper::upload($ftpServer, $mudInfo);
        }
        echo '<pre style="transform-origin: top;background: #fff;display: block;font-size:12px;transform: scale(0.9);max-width: 960px;margin: auto;min-height: 400px;">
<a _bk=1 target="_blank" href="'.UrlHelper::rootDir(zipHelper::zipToDir($iden)).'">访问：'.zipHelper::zipToDir($iden).'</a><br><br>';
        print_r($zip);
        echo '</pre>';
    }

    public function actionCreateForm() {
        $optab = Lev::stripTags(Lev::GPv('optab'));
        $formInfo = LevfmForms::findOne(['name'=>$optab]);
        parent::redirect(Lev::toPgRoute(['r'=>'forms/form', 'id'=>'levfm', 'name'=>$optab, 'opid'=>$formInfo['id']]));
    }

    public function actionExport() {

        if (Lev::POSTv('dosubmit')) {
            echo json_encode(static::doExport());
            return;
        }
        $opid = floatval(Lev::GPv('opid'));

        $modInfo = ModulesHelper::findOne(['id'=>$opid]);
        $iden = $modInfo['identifier'];
        $modInfo = static::getExportData($modInfo);

        Lev::$app['title'] = $modInfo['name'].' &raquo; 导出模块信息';
        $tips = '导出文件位于：@modules/'.ModulesHelper::getIdenDir($iden, $modInfo['classdir']).'/migrations/data/moduleinfo.php';

        Viewv::render('_modules/export', [
            'tips' => $tips,
            'iden' => $iden,
            'settings' => static::doExport($opid, true),
        ]);

    }

    /**
     *
     * 老版 - 已停更
     */
    public function actionForm() {

        if (Lev::POSTv('dosubmit')) {
            echo json_encode(static::save());
            return;
        }

        $opid = intval(Lev::GETv('opid'));

        $opInfo = $opid >0 ? ModulesHelper::findOne(['id'=>$opid]) : [];
        $inputs = static::inputs();
        if ($opInfo) {
            $_GET['#iden'] = $opInfo['identifier'];

            $opInfo['_adminNavs'] = Lev::getSettings($opInfo['settings'], '_adminNavs');
            $opInfo['_adminClassify'] = Lev::getSettings($opInfo['settings'], '_adminClassify');
            $opInfo = Modelv::setFormSettings($opInfo['settings'], $opInfo);
        }

        if ($opInfo) {
            Lev::$app['title'] = '编辑模块【' . $opInfo['name'] . '】';
        }else {
            Lev::$app['title'] = '创建新模块';
        }

        Viewv::render('_modules/form', [
            'inputs' => $inputs,
            'inputsValues' => $opInfo,
        ]);

    }

    public static function fieldTypeid() {
        return [
            0 => '三方模块',
            8 => '官方模块',
            9 => '基础模块',
        ];
    }

    public static function getModuleTableColumnsComment($tables) {
        $datas = [];
        if ($tables) {
            foreach ($tables as $table) {
                ($columns = dbHelper::getColumnsComment(dbHelper::tableName($table))) &&
                $datas[$table] = $columns;
            }
        }
        return $datas;
    }

    private static function doExport($opid = 0, $preview = false) {
        return Form_lev_modules::doExport($opid, $preview);
    }
    /**
     * 老版 - 已停更
     * @return string|array
     */
    private static function doExport_old($opid = 0, $preview = false) {
        !$opid && $opid = intval(Lev::GPv('opid'));
        $inLev = zipHelper::getCheckINLEVphpcode();
        $settings = ModulesHelper::findOne(['id'=>$opid]);
        $settings = static::getExportData($settings);

//        $sets = Lev::getSettings($settings['settings']);
//        $sets['columns'] = static::getModuleTableColumnsComment($sets['dropTables']);
//        $settings['settings'] = Lev::setSettings($sets);

        $data = '<?php '.$inLev.' return ' . cacheFileHelpers::varExportSerialize($settings) . ';';
        if ($preview) {//预览
            return $data;
        }
        //$settings['classdir'] && $settings['status'] = 1;
        $file = Lev::getAlias('@modules/'.ModulesHelper::getIdenDir($settings['identifier'], $settings['classdir']).'/migrations/data/');
        cacheFileHelpers::mkdirv($file);
        file_put_contents($file . 'moduleinfo.php', $data);
        return (Lev::responseMsg());
    }
    public static function getExportData($data) {
        unset($data['id'], $data['typeid']);
        return $data;
    }

    public static function banIdens($iden) {
        //return Form_lev_modules::banIdens($iden);



        if ($iden === 'levmodules') {
            return false;
        }
        $banIdens = ['module'];
        foreach ($banIdens as $v) {
            if (stripos($iden, $v) !== false) {
                $tip = '模块标识关键字【'.str_ireplace($v, '<b class="red">'.$v.'</b>', $iden).'】被占用';
                return Modelv::errorMsg('module[identifier]', $tip, -22022);
            }
        }
        return false;
    }
    public static function checkErrorIden($iden) {
        //return Form_lev_modules::checkErrorIden($iden);


        if ($msg = static::banIdens(basename($iden))) {
            return $msg;
        }
        if (strpos($iden, 'tab__') === 0 || strpos($iden, '/tab__') !== false) {
            return Modelv::errorMsg('module[identifier]', '模块标识禁止用占位符"tab__"开头', -2200);
        }
        if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_\/]+$/', $iden)) {
            return Modelv::errorMsg('module[identifier]', '只允许a-z、0-9、/和下划线必须以字母开头', -2201);
        }
        if (Lev::GPv('generateFiles') && generateHelper::isExistIden($iden)) {
            return Modelv::errorMsg('module[identifier]', '模块标识目录已存在', -2202);
        }
        return false;
    }

    /**
     * 老版 - 已停更
     * @return array|bool
     */
    public static function save()
    {
        $upData = Lev::stripTags(Lev::POSTv('module'));
        if (empty($upData['name'])) {
            return Modelv::errorMsg('module[name]', '模块名称不能为空', -2100);
        }

        $idenDir = $upData['classdir'] ? ModulesHelper::getIdenDir($upData['identifier'], $upData['classdir']) : $upData['identifier'];
        if ($errMsg = static::checkErrorIden($idenDir)) {
            return $errMsg;
        }
        $opid = intval(Lev::GPv('opid'));
        if (ModulesHelper::findOne("identifier='".$upData['identifier']."' AND id<>$opid")) {
            return Modelv::errorMsg('module[identifier]', '模块标识已存在', -2203);
        }

        $opInfo = $opid >0 ? ModulesHelper::findOne(['id'=>$opid]) : [];
        $upData = inputsWidget::formatSaveInputsData($upData, static::inputs());
        $settings = $opInfo ? Lev::getSettings($opInfo['settings']) : [];
        $settings['_adminNavs'] = $upData['_adminNavs'];
        $settings['_adminClassify'] = $upData['_adminClassify'];
        $upData['settings'] = Lev::setSettings($settings);

        $_navTitle = $upData['_navTitle'];
        unset($upData['_adminNavs'], $upData['_adminClassify'], $upData['_navTitle']);

        empty($upData['version']) && $upData['version'] = date('Ymd', Lev::$app['timestamp']).'.01';
        empty($upData['copyright']) && $upData['copyright'] = 'Lev';

        $upData['uptime'] = Lev::$app['timestamp'];
        $upData['versiontime'] = Lev::$app['timestamp'];

        $upData = ModulesHelper::safeColumns($upData);//print_r($upData);exit;
        if ($opInfo) {
            $rs = ModulesHelper::update($upData, ['id'=>$opid]);
            //$rs = ModulesHelper::saveInputs($upData, ['id'=>$opid]);
        }else {
            $upData['addtime'] = Lev::$app['timestamp'];
            $rs = ModulesHelper::insert($upData, true);
            //$rs = ModulesHelper::saveInputs($upData, [], true);
            $opid = $rs;
        }
        if ($rs) {
            if (Lev::GPv('generateAdminFiles')) {
                generateControllerHelper::createAdminController($upData['identifier'], Lev::getSettings($settings['_adminNavs']));
            }

            $upData['navTitle'] = $_navTitle;
            Lev::GPv('generateFiles') && generateHelper::createModule($upData['identifier'], $upData);
            generateHelper::isExistIden($idenDir) && static::doExport($opid);
            ModulesHelper::setCaches();
            return Lev::responseMsg();
        }
        return Lev::responseMsg(-2203, '保存失败');
    }

    /**
     * 老版 - 已停更
     * @return array
     */
    public static function inputs() {
        return array (
            '_navTitle' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => 'DZ论坛主导航名称',
                    'placeholder' => '主要用于设置dz的XML安装文件，不入库，仅对创建文件时修改XML导航名称',
                    'inputname' => '_navTitle',
                    'inputtype' => 'text',
                    'inputvalue' => '',
                    'settings' => '',
                    'displayorder' => '1',
                    'status' => '0',
                ),
            'classdir' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '父模块标识',
                    'placeholder' => '仅允许一级子模块（即：子模块不允许再有子模块）',
                    'inputname' => 'classdir',
                    'inputtype' => 'selectcode',
                    'inputvalue' => '',
                    'settings' => 'modules\\levmodules\\levmodulesHelper',
                    'displayorder' => '1',
                    'status' => '0',
                ),
            'name' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '名称',
                    'placeholder' => '自动添加到网站关建词尾部，用于SEO优化',
                    'inputname' => 'name',
                    'inputtype' => 'text',
                    'inputvalue' => '',
                    'settings' => '',
                    'displayorder' => '1',
                    'status' => '0',
                ),
            'identifier' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '唯一标识',
                    'placeholder' => '自动添加到网站关建词尾部，用于SEO优化',
                    'inputname' => 'identifier',
                    'inputtype' => 'text',
                    'inputvalue' => '',
                    'settings' => '',
                    'displayorder' => '2',
                    'status' => '0',
                ),
            'descs' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '简短描述',
                    'placeholder' => '简单概括模块的功能<br>自动添加到网站描述尾部，用于SEO优化',
                    'inputname' => 'descs',
                    'inputtype' => 'text',
                    'inputvalue' => '',
                    'settings' => '',
                    'displayorder' => '4',
                    'status' => '0',
                ),
            'copyright' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '版权',
                    'placeholder' => '留空自动填写版权：Lev',
                    'inputname' => 'copyright',
                    'inputtype' => 'text',
                    'inputvalue' => '',
                    'settings' => '',
                    'displayorder' => '5',
                    'status' => '0',
                    'uptime' => '1621146529',
                    'addtime' => '1621146529',
                ),
            'version' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '版本号',
                    'placeholder' => '留空自动生成Ymd.01版本号',
                    'inputname' => 'version',
                    'inputtype' => 'text',
                    'inputvalue' => '',
                    'settings' => '',
                    'displayorder' => '6',
                    'status' => '0',
                ),
            '_adminClassify' =>
                array (
                    'moduleidentifier' => 'modules',
                    'classify' => '',
                    'title' => '设置分类导航',
                    'placeholder' => '',
                    'inputname' => '_adminClassify',
                    'inputtype' => 'navs',
                    'inputvalue' => '',
                    'settings' => 'order=排序===60
status=开关
name=设置分类名称===160
descs=备注描述',
                    'displayorder' => '7',
                    'status' => '0',
                ),


//            '_adminNavs' =>
//                array (
//                    'moduleidentifier' => 'modules',
//                    'classify' => '',
//                    'title' => '管理导航',
//                    'placeholder' => '',
//                    'inputname' => '_adminNavs',
//                    'inputtype' => 'navs',
//                    'inputvalue' => '',
//                    'settings' => 'order=排序===60
//name=名称===100
//target=打开方式==lev\helpers\SettingsHelper=100
//status=开关
//tableName=数据表==lev\helpers\SettingsHelper=100
//link=链接地址=使用Lev::toReRoute([link,identifier])解析此地址',
//                    'displayorder' => '8',
//                    'status' => '0',
//                ),
            '_adminNavs'=> array(
                'moduleidentifier' => 'modules',
                'classify'=>'',
                'title'=>'管理导航',
                'placeholder'=>'',
                'inputname'=>'_adminNavs',
                'inputtype'=>'tablesForm',
                'inputvalue'=>'',
                'settings'=>serialize(array (
                    'tablesForm' =>
                        array (
                            1 =>
                                array (
                                    'id' => 1,
                                    'order' => '1',
                                    'title' => 'ID',
                                    'inputname' => 'id',
                                    'inputtype' => 'number',
                                    'width' => '40',
                                    'settings' => '',
                                    'placeholder' => '',
                                    'inputvalue' => '',
                                ),
                            2 =>
                                array (
                                    'id' => 2,
                                    'order' => '2',
                                    'title' => '排序',
                                    'inputname' => 'order',
                                    'inputtype' => 'number',
                                    'width' => '40',
                                    'settings' => '',
                                    'placeholder' => '',
                                    'inputvalue' => '',
                                ),
                            3 =>
                                array (
                                    'id' => 3,
                                    'order' => '3',
                                    'title' => '导航名称',
                                    'inputname' => 'name',
                                    'inputtype' => 'text',
                                    'width' => '100',
                                    'settings' => '',
                                    'placeholder' => '',
                                    'inputvalue' => '',
                                ),
                            4 =>
                                array (
                                    'id' => 4,
                                    'order' => '4',
                                    'title' => '打开方式',
                                    'inputname' => 'target',
                                    'inputtype' => 'selectcode',
                                    'width' => '100',
                                    'settings' => 'lev\helpers\SettingsHelper',
                                    'placeholder' => '',
                                    'inputvalue' => '',
                                ),
                            5 =>
                                array (
                                    'id' => 5,
                                    'order' => '5',
                                    'title' => '开关',
                                    'inputname' => 'status',
                                    'inputtype' => 'radio',
                                    'width' => '',
                                    'settings' => '',
                                    'placeholder' => '',
                                    'inputvalue' => '',
                                ),
                            6 =>
                                array (
                                    'id' => 6,
                                    'order' => '6',
                                    'title' => '数据表',
                                    'inputname' => 'tableName',
                                    'inputtype' => 'selectSearch',
                                    'width' => '120',
                                    'settings' => 'modules\levmodules\helpers\levmodulesSetHelper',
                                    'placeholder' => '设置后将自动创建列表控制器文件',
                                    'inputvalue' => '',
                                ),
                            7 =>
                                array (
                                    'id' => 7,
                                    'order' => '7',
                                    'title' => '创建表单',
                                    'inputname' => 'formInputs',
                                    'inputtype' => 'selectSearch',
                                    'width' => '120',
                                    'settings' => 'modules\levmodules\helpers\levmodulesSetHelper',
                                    'placeholder' => '设置后将自动为列表控制器创建一个表单',
                                    'inputvalue' => '',
                                ),
                            17 =>
                                array (
                                    'id' => 17,
                                    'order' => '17',
                                    'title' => '链接地址或路由名称(例：admin-user)',
                                    'inputname' => 'link',
                                    'inputtype' => 'text',
                                    'width' => '',
                                    'settings' => '',
                                    'placeholder' => '使用Lev::toReRoute([link,identifier])解析此地址',
                                    'inputvalue' => '',
                                ),
                            25 =>
                                array (
                                    'id' => 25,
                                    'order' => '25',
                                    'title' => '强制',
                                    'inputname' => 'forceGen',
                                    'inputtype' => 'radio',
                                    'width' => '',
                                    'settings' => '',
                                    'placeholder' => '强制重新生成控制器文件',
                                    'inputvalue' => 1,
                                ),
                        ),
                )),
                'displayorder'=>'3',
                'status'=>'0',
            ),

        );
    }
}